﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LdapPravilaPodrobno.aspx.cs" Inherits="Sio.Mdm.Web.Instalacija.LdapPravilaPodrobno" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    
    <style type="text/css">
        .cbExtended-list 
        {
            width: 398px;
            font: 11px tahoma,arial,helvetica,sans-serif;
        }
        
        .cbExtended-list th {
            font-weight: bold;
        }
        
        .cbExtended-list td, .cbExtended-list th {
            padding: 3px;
        }
                
        .cbOrgarnizacija-backgr {
            background: #D1DDEF;
            border-top: 1px dotted #B5B8C8;
            border-bottom: 1px dotted #B5B8C8;              
            padding-top:5px;
            padding-bottom:5px;         
        }
    </style>   

</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
    <ext:Store ID="StoreOrgarnizacije" runat="server">
	<Reader>
		<ext:JsonReader IDProperty="OrganizacijaId">
			<Fields>
				<ext:RecordField Name="OrganizacijaId" Type="Int" />
				<ext:RecordField Name="Naziv" Type="String" />
			</Fields>
		</ext:JsonReader>
	</Reader>
    </ext:Store>
    
    <ext:Store ID="StoreStrezniki" runat="server">
	<Reader>		
        <ext:JsonReader IDProperty="LdapStreznikID">
            <Fields>
                <ext:RecordField Name="LdapStreznikID" Type="Int" />                        
                <ext:RecordField Name="Ime" Type="String" />
                <ext:RecordField Name="Opis" Type="String" />                                                                                              
            </Fields>
        </ext:JsonReader>
    </Reader>		
    </ext:Store>
    
    <ext:Store ID="StorePredloge" runat="server">
	<Reader>		
        <ext:JsonReader IDProperty="LdapPredlogaID">
            <Fields>
                <ext:RecordField Name="LdapPredlogaID" Type="Int" />                        
                <ext:RecordField Name="Ime" Type="String" />
                <ext:RecordField Name="Opis" Type="String" />                                                                                              
            </Fields>
        </ext:JsonReader>
    </Reader>		
    </ext:Store>
    
    <ext:Store ID="StoreTipiEntitete" runat="server">
	<Reader>
		<ext:ArrayReader IDProperty="TipID">
			<Fields>
				<ext:RecordField Name="TipID" Type="Int" />
				<ext:RecordField Name="Naziv" Type="String" />
			</Fields>
		</ext:ArrayReader>
	</Reader>
    </ext:Store>
    
        <ext:Viewport ID="Viewport1" runat="server" Layout="Fit">
        <Content>
            <sio:FormPanel runat="server" ID="FormPanel1" MonitorPoll="500" MonitorValid="true" Layout="fit" Border="false">
		    <Items>
            <ext:Panel 
            ID="Panel1" 
            runat="server"             
            HideBorders="true"                        
            PaddingSummary="5px 5px 0"            
            Width="350"
            Frame="true"
            ButtonAlign="Center"
            Layout="Form">            
            <Items>            
                
                <ext:ComboBox ID="cmbOrgarnizacije" FieldLabel="Organizacija" EmptyText="Izberi organizacijo..." runat="server" Editable="false" SelectOnFocus="true"
                Width="200" StoreID="StoreOrgarnizacije" DisplayField="Naziv" ValueField="OrganizacijaId" AllowBlank="false" ItemCls="cbOrgarnizacija-backgr">				    		
			    <DirectEvents>			    
			        <Select OnEvent="OnOrgarnizacijaChanged"></Select>
			    </DirectEvents>
			    </ext:ComboBox>
                
                <ext:TextField ID="txtIme" runat="server" FieldLabel="Ime" AllowBlank="false" Width="200" />
                <ext:TextField ID="txtOpis" runat="server" FieldLabel="Opis" Width="400" />
                <ext:TextField ID="txtBaseDN" runat="server" FieldLabel="Base DN" AllowBlank="false" Width="400" />
                			    			                    
                <ext:ComboBox ID="cmbStreznik" runat="server" FieldLabel="Streznik" EmptyText="Izberi streznik..." Width="200" TypeAhead="true" ForceSelection="true" StoreID="StoreStrezniki"
                DisplayField="Ime" ValueField="LdapStreznikID" MinChars="1" ListWidth="400" ItemSelector="tr.list-item" AllowBlank="false">
                <Template ID="Template1" runat="server">
                <Html>
					<tpl for=".">
						<tpl if="[xindex] == 1">
							<table class="cbExtended-list">
								<tr>
									<th>Streznik</th>
									<th>Opis</th>
								</tr>
						</tpl>
						<tr class="list-item">
							<td style="padding:3px 0px;">{Ime}</td>
							<td>{Opis}</td>
						</tr>
						<tpl if="[xcount-xindex]==0">
							</table>
						</tpl>
					</tpl>
				</Html>
                </Template>                
                </ext:ComboBox>

                <ext:ComboBox ID="cmbPredloga" runat="server" FieldLabel="Predloga" EmptyText="Izberi predlogo" Width="200" TypeAhead="true" ForceSelection="true" StoreID="StorePredloge"
                DisplayField="Ime" ValueField="LdapPredlogaID" MinChars="1" ListWidth="400" ItemSelector="tr.list-item" AllowBlank="false">
                <Template ID="Template2" runat="server">
                <Html>
					<tpl for=".">
						<tpl if="[xindex] == 1">
							<table class="cbExtended-list">
								<tr>
									<th>Predloga</th>
									<th>Opis</th>
								</tr>
						</tpl>
						<tr class="list-item">
							<td style="padding:3px 0px;">{Ime}</td>
							<td>{Opis}</td>
						</tr>
						<tpl if="[xcount-xindex]==0">
							</table>
						</tpl>
					</tpl>
				</Html>
                </Template>                
                </ext:ComboBox>
                  
                <ext:ComboBox ID="cmbTipEntitete" FieldLabel="Tip entitete" EmptyText="Izberi entiteto" runat="server" Editable="false" SelectOnFocus="true"
                Width="200" StoreID="StoreTipiEntitete" DisplayField="Naziv" ValueField="TipID" AllowBlank="false">				    		
			    </ext:ComboBox>
                         
                <ext:Checkbox ID="chkAktivno" FieldLabel="Aktivno" runat="server" />                     
                                
                <ext:Label ID="lblWarning" runat="server" Text="Warning..." Icon="Error" Hidden="true"/>
                              
            </Items>            
            </ext:Panel>
             </Items>
             <Listeners>
				  <ClientValidation Handler="#{LdapPravilaPodrobnoProxy}.disableButton('Save', !valid);" />
			</Listeners>
            </sio:FormPanel>   
        </Content>
    </ext:Viewport>
    
    <sio:DialogProxy runat="server" ID="LdapPravilaPodrobnoProxy" WindowId="DialogPravilaPodrobno">
	<DirectEvents>		
		<ButtonClicked OnEvent="ButtonClicked">
		<ExtraParams>
			<ext:Parameter Name="button" Value="item.id" Mode="Raw" />
		</ExtraParams>
		</ButtonClicked>		
	</DirectEvents>
	</sio:DialogProxy>
    
    </form>
</body>
</html>
